import Vue from 'vue';
import Router from 'vue-router';
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err =>{
    Vue.prototype.$NProgress.done()
  })
}

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import('../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/tongjiman',
                    component: () => import( '../components/page/tongjiman/index.vue'),
                    meta: { title: '统计管理' }
                },{
                    path: 'publicity',
                    component: () => import( '../components/page/xuanchuanman'),
                },
                {
                    path: '/xuanchuanmannews',
                    component: () => import( '../components/page/xuanchuanman/news.vue'),
                    meta: { title: '新闻公告' }
                },
                {
                    path: '/xuanchuanmanzhengce',
                    component: () => import( '../components/page/xuanchuanman/zhengce.vue'),
                    meta: { title: '政策' }
                },
                {
                    path: '/xuanchuanmanzhanshi',
                    component: () => import( '../components/page/xuanchuanman/zhanshi.vue'),
                    meta: { title: '实际样例展示' }
                },
                {
                    path: '/kaohemanrule',
                    component: () => import( '../components/page/kaoheman/rule.vue'),
                    meta: { title: '评分规则' }
                },
                {
                    path: '/kaoheman',
                    component: () => import( '../components/page/kaoheman/index.vue'),
                    meta: { title: '考核评分' }
                },
                {
                    path: '/kaohemanpingfen',
                    component: () => import( '../components/page/kaoheman/pingfen.vue'),
                    meta: { title: '考核评分' }
                },
                {
                    path: '/jiancemangongbao',
                    component: () => import( '../components/page/jianceman/gongbao.vue'),
                    meta: { title: '水土流失管理' }
                },
                {
                    path: '/jiancemanxinxi',
                    component: () => import( '../components/page/jianceman/xinxi.vue'),
                    meta: { title: '水土流失管理' }
                },
                {
                    path: '/zerenmanshuitu',
                    component: () => import( '../components/page/zerenman/shuitu.vue'),
                    meta: { title: '水土流失管理' }
                },
                {
                    path: '/zerenmanfee',
                    component: () => import( '../components/page/zerenman/fee.vue'),
                    meta: { title: '工作经费管理' }
                },
                {
                    path: '/gongchengmanbase',
                    component: () => import( '../components/page/gongchengman/base.vue'),
                    meta: { title: '基础信息' }
                },
                {
                    path: '/gongchengmanpanding',
                    component: () => import( '../components/page/gongchengman/panding.vue'),
                    meta: { title: '判定信息' }
                },
                {
                    path: '/gongchengmanyujing',
                    component: () => import( '../components/page/gongchengman/yujing.vue'),
                    meta: { title: '预警提醒' }
                },
                {
                    path: '/gongchengmanzhenggai',
                    component: () => import( '../components/page/gongchengman/zhenggai.vue'),
                    meta: { title: '整改管理' }
                },
                {
                    path: '/gongchengmantongbao',
                    component: () => import( '../components/page/gongchengman/tongbao.vue'),
                    meta: { title: '通报扣分' }
                },



                {
                    path: '/systemmanuser',
                    component: () => import( '../components/page/systemman/user.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/systemmanrole',
                    component: () => import( '../components/page/systemman/role.vue'),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/promanxinyong',
                    component: () => import( '../components/page/proman/xinyong.vue'),
                    meta: { title: '信用管理' }
                },
                {
                    path: '/promanjiandu',
                    component: () => import( '../components/page/proman/jiandu.vue'),
                    meta: { title: '监督管理' }
                },
                {
                    path: '/promanzhifa',
                    component: () => import( '../components/page/proman/zhifa.vue'),
                    meta: { title: '执法管理' }
                },
                {
                    path: '/promanyanshou',
                    component: () => import( '../components/page/proman/yanshou.vue'),
                    meta: { title: '验收管理' }
                },
                {
                    path: '/promanfangan',
                    component: () => import( '../components/page/proman/fangan.vue'),
                    meta: { title: '方案抽查' }
                },
                {
                    name:'promanbase',
                    path: '/promanbase',
                    component: () => import( '../components/page/proman/base.vue'),
                    meta: { title: '基础信息' }
                },
                {
                    path: '/dashboard',
                    component: () => import( '../components/page/Dashboard.vue'),
                    meta: { title: '监管一张图',auth: ['dashboard'] }
                },
                // 2021  3.6版本
                {
                    path: '/waterloss',
                    component: () => import('../components/page/waterloss'),
                    meta: { title: '水土流失消长变化',auth: ['waterloss']}
                }, 
                {
                    path: '/implementationoffunds',
                    component: () => import('../components/page/implementationFunds'),
                    meta: { title: '水保工作经费落实情况管理'}
                },
                // 生产建设项目监督管理
                {
                    path: '/programSummarize',
                    component: () => import('../components/page/programSummarize'),
                    meta: { title: '项目综合信息'}
                },
                {
                    path: '/planCheck',
                    component: () => import('../components/page/planCheck'),
                    meta: { title: '项目综合信息'}
                },{
                    path: '/compensation',
                    component: () => import('../components/page/compensation'),
                    meta: { title: '补偿费征缴情况'}
                },
                {
                    path: '/dailySupervise',
                    component: () => import('../components/page/dailySupervise'),
                    meta: { title: '日常监督管理'}
                },
                {
                    path: '/acceptManage',
                    component: () => import('../components/page/acceptManage'),
                    meta: { title: '验收管理'}
                },
                {
                    path: '/illegalItemsSubmitted',
                    component: () => import('../components/page/illegalItems/submitted'),
                    meta: { title: '两单类型（重点关注/黑名单）'}
                },
                {
                    path: '/statistics',
                    component: () => import('../components/page/illegalItems/statistics'),
                    meta: { title: '违法违规项目统计'}
                },
                {
                    path: '/illegalItemsWarning',
                    component: () => import('../components/page/illegalItems/warning.vue'),
                    meta: { title: '预警管理'}
                },
                {
                    path: '/illegalItemsRectify',
                    component: () => import('../components/page/illegalItems/rectify/index'),
                    meta: { title: '整改管理'}
                },
                {
                    path: '/illegalItemsRectifyRecord',
                    component: () => import('../components/page/illegalItems/rectify/record'),
                    meta: { title: '整改记录'}
                },
                {
                    path: '/illegalItemsRectifyStatistics',
                    component: () => import('../components/page/illegalItems/rectify/statistics'),
                    meta: { title: '整改统计'}
                },
                /**
                 * 水土保持重点工程管理
                 */
                {
                    path: '/keepProgramBaseInfo',
                    component: () => import('../components/page/keepProgramBaseInfo'),
                    meta: { title: '基本信息'}
                },
                {
                    path: '/keepProgramProcess',
                    component: () => import('../components/page/keepProgramProcess'),
                    meta: { title: '重点工程过程管理'}
                },
                {
                    path: '/keepProgramChart',
                    component: () => import('../components/page/keepProgramChart'),
                    meta: { title: '问题汇总分析图表'}
                },
                {
                    path: '/keepWarning',
                    component: () => import('../components/page/keepWarning'),
                    meta: { title: '预警管理'}
                },
                {
                    path: '/keepRectify',
                    component: () => import('../components/page/keepRectify'),
                    meta: { title: '整改管理'}
                }, 
                {
                    path: '/keepRectifyRecord',
                    component: () => import('../components/page/keepRectify/record'),
                    meta: { title: '整改记录'}
                },
                {
                    path: '/keepRectifyStatistics',
                    component: () => import('../components/page/keepRectify/statistics'),
                    meta: { title: '整改统计'}
                },
                 /**
                 * 水土流失治理任务完成情况
                 */
                {
                    path: '/reduceCover',
                    component: () => import('../components/page/reduceCover'),
                    meta: { title: '面上治理任务完成情况'}
                },
                {
                    path: '/reduceImportant',
                    component: () => import('../components/page/reduceImportant'),
                    meta: { title: '重点工程水土流失治理任务完成情况'}
                },
                {
                    path: '/reduceMap',
                    component: () => import('../components/page/reduceMap'),
                    meta: { title: '水土流失治理图斑'}
                },
                /**
                 * 水保监测和信息化管理
                 */
                {
                    path: '/monitorProgram',
                    component: () => import('../components/page/monitorProgram'),
                    meta: { title: '工程项目信息录入情况'}
                },
                {
                    path: '/monitorSupervise',
                    component: () => import('../components/page/monitorSupervise'),
                    meta: { title: '开展水保信息化监管工作'}
                },
                {
                    path: '/monitorReduce',
                    component: () => import('../components/page/monitorReduce'),
                    meta: { title: '配合开展水土流失动态监测和水土保持公报工作'}
                },
                {
                    path: '/monitorWarning',
                    component: () => import('../components/page/monitorWarning'),
                    meta: { title: '预警管理'}
                },
                {
                    path: '/monitorRectify',
                    component: () => import('../components/page/monitorRectify'),
                    meta: { title: '整改统计'}
                },{
                    path: '/monitorRectifyRecord',
                    component: () => import('../components/page/monitorRectify/record'),
                    meta: { title: '整改记录'}
                },
                {
                    path: '/monitorRectifyStatistics',
                    component: () => import('../components/page/monitorRectify/statistics'),
                    meta: { title: '整改统计'}
                },{
                    path: '/monitorBrief',
                    component: () => import('../components/page/monitorBrief'),
                    meta: { title: '通报列表'}
                },
                {
                    path: '/monitorPoint',
                    component: () => import('../components/page/monitorPoint'),
                    meta: { title: '扣分规则'}
                },
                /**
                 * 宣传教育情况
                 */
                {
                    path: '/monitorPoint',
                    component: () => import('../components/page/monitorPoint'),
                    meta: { title: '扣分规则'}
                },
                {
                    path: '/icon',
                    component: () => import(/* "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标',auth: ['icon'] }
                },
                {
                    path: '/table',
                    component: () => import(/* "table" */ '../components/page/BaseTable.vue'),
                    meta: { title: '基础表格' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* "tabs" */ '../components/page/Tabs.vue'),
                    meta: { title: 'tab选项卡' }
                },
                {
                    path: '/form',
                    component: () => import(/* "form" */ '../components/page/BaseForm.vue'),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* "editor" */ '../components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* "markdown" */ '../components/page/Markdown.vue'),
                    meta: { title: 'markdown编辑器' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* "upload" */ '../components/page/Upload.vue'),
                    meta: { title: '文件上传' }
                },
                
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* "drag" */ '../components/page/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/404',
                    component: () => import(/* "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
